<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>一行多列水平垂直居中</title>
   <style>

       .box{
           margin: 20px;
       }

       .box-in{
           display: table-cell;
           vertical-align: middle;
           height: 100px;
           width: 400px;
           border: 1px solid #f20;
           text-align: center;
       }

       .item{
           width: 100px;
           height: 60px;
           border: 1px solid #fff;
           color: #fff;
           display: inline-block;  /*或者 inline 也可以 */
           line-height: 60px;
           background-color: aqua;
           /* margin: 20px; */
       }

   </style>
</head>
<body>
    <div class="box">
        <div class="box-in">
            <div class="item">这是Item1</div>
            <div class="item">这是Item2</div>
            <div class="item">这是Item3</div>
            <div class="item">这是Item4</div>
            <div class="item">这是Item5</div>
            <div class="item">这是Item6</div>
            <div class="item">这是Item7</div>
            <div class="item">这是Item8</div>
            <div class="item">这是Item9</div>
            <div class="item">这是Item10</div>
        </div>
    </div>
    <div class="box">
        <div class="box-in">
            <div class="item">这是Item4</div>
            <div class="item">这是Item5</div>
        </div>
    </div>
</body>
</html>